﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WastedMechanics.CharState
{
    class CharStateWalkPistolRecoil : CharStateWalk
    {
        public CharStateWalkPistolRecoil(Character chr)
            : base(chr, "WalkPistolShoot")
        {            
        }

        public override void Enter()
        {            
            base.Enter();
            Character.ResetAnimation(AnimationName);
            Character.IsAiming = true;
        }

        public override void Exit()
        {
            Character.IsAiming = false;
            base.Exit();
        }

        public override void Update()
        {
            base.Update();
            if (Character.AnimBlender.Target.TimePosition > Character.AnimBlender.Target.Length * 0.99f)            
                Character.SwitchState(new CharStateWalkPistolAim(Character));            
        }

        public override void HaltOrder()
        {            
        }        

        public override CharState GetIdleState()
        {
            return new CharStateIdlePistolAim(Character);
        }

        public override CharState GetFallingState()
        {
            return new CharStateFallPistol(Character);
        }
    }
}
